//
//  BlurImageView.m
//  TravelFirst
//
//  Created by lanou on 15/9/21.
//  Copyright (c) 2015年 吴娅君. All rights reserved.
//

#import "BlurImageView.h"

@implementation BlurImageView

- (instancetype)initWithFrame:(CGRect)frame target:(id)target action:(SEL)action
{
    if (self = [super initWithFrame:frame]) {
        
        UIVisualEffectView *effectView = [[UIVisualEffectView alloc] initWithEffect:[UIBlurEffect effectWithStyle:UIBlurEffectStyleDark]];
        effectView.frame = CGRectMake(0, 0, frame.size.width, frame.size.height);
        effectView.alpha = 0.5;
        [self addSubview:effectView];
        
        self.backButton = [UIButton buttonWithType:UIButtonTypeCustom];
        self.backButton.frame = CGRectMake(0, 0, frame.size.width, frame.size.height);
        [self.backButton addTarget:target action:action forControlEvents:UIControlEventTouchUpInside];
        [self addSubview:self.backButton];
        
        self.userInteractionEnabled = YES;
    }
    return self;
}

@end
